<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span id="local-6989586621679562089"></span><span class="hs-pragma">{-# LANGUAGE Trustworthy #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE NoImplicitPrelude
           , ExistentialQuantification
           , MagicHash
           , RecordWildCards
           , PatternSynonyms
  #-}</span><span>
</span><span id="line-8"></span><span class="hs-pragma">{-# OPTIONS_HADDOCK not-home #-}</span><span>
</span><span id="line-9"></span><span>
</span><span id="line-10"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Module      :  GHC.Exception.Type</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- Copyright   :  (c) The University of Glasgow, 1998-2002</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- License     :  see libraries/base/LICENSE</span><span>
</span><span id="line-15"></span><span class="hs-comment">--</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- Maintainer  :  cvs-ghc@haskell.org</span><span>
</span><span id="line-17"></span><span class="hs-comment">-- Stability   :  internal</span><span>
</span><span id="line-18"></span><span class="hs-comment">-- Portability :  non-portable (GHC extensions)</span><span>
</span><span id="line-19"></span><span class="hs-comment">--</span><span>
</span><span id="line-20"></span><span class="hs-comment">-- Exceptions and exception-handling functions.</span><span>
</span><span id="line-21"></span><span class="hs-comment">--</span><span>
</span><span id="line-22"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-23"></span><span>
</span><span id="line-24"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Exception.Type</span><span>
</span><span id="line-25"></span><span>       </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Exception.Type.html#Exception"><span class="hs-identifier">Exception</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>    </span><span class="hs-comment">-- Class</span><span>
</span><span id="line-26"></span><span>       </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Exception.Type.html#SomeException"><span class="hs-identifier">SomeException</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Exception.Type.html#ArithException"><span class="hs-identifier">ArithException</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-27"></span><span>       </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Exception.Type.html#divZeroException"><span class="hs-identifier">divZeroException</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Exception.Type.html#overflowException"><span class="hs-identifier">overflowException</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Exception.Type.html#ratioZeroDenomException"><span class="hs-identifier">ratioZeroDenomException</span></a></span><span>
</span><span id="line-28"></span><span>       </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Exception.Type.html#underflowException"><span class="hs-identifier">underflowException</span></a></span><span>
</span><span id="line-29"></span><span>       </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-30"></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Maybe.html"><span class="hs-identifier">Data.Maybe</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Typeable.html"><span class="hs-identifier">Data.Typeable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Typeable.Internal.html#Typeable"><span class="hs-identifier">Typeable</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Typeable.html#cast"><span class="hs-identifier">cast</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-33"></span><span>   </span><span class="hs-comment">-- loop: Data.Typeable -&gt; GHC.Err -&gt; GHC.Exception</span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Base.html"><span class="hs-identifier">GHC.Base</span></a></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Show.html"><span class="hs-identifier">GHC.Show</span></a></span><span>
</span><span id="line-36"></span><span>
</span><span id="line-37"></span><span class="hs-comment">{- |
The @SomeException@ type is the root of the exception type hierarchy.
When an exception of type @e@ is thrown, behind the scenes it is
encapsulated in a @SomeException@.
-}</span><span>
</span><span id="line-42"></span><span class="hs-keyword">data</span><span> </span><span id="SomeException"><span class="annot"><a href="GHC.Exception.Type.html#SomeException"><span class="hs-identifier hs-var">SomeException</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679562112"><span class="annot"><a href="#local-6989586621679562112"><span class="hs-identifier hs-type">e</span></a></span></span><span> </span><span class="hs-operator">.</span><span> </span><span class="annot"><a href="GHC.Exception.Type.html#Exception"><span class="hs-identifier hs-type">Exception</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679562112"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span id="SomeException"><span class="annot"><a href="GHC.Exception.Type.html#SomeException"><span class="hs-identifier hs-var">SomeException</span></a></span></span><span> </span><span class="annot"><a href="#local-6989586621679562112"><span class="hs-identifier hs-type">e</span></a></span><span>
</span><span id="line-43"></span><span>
</span><span id="line-44"></span><span class="hs-comment">-- | @since 3.0</span><span>
</span><span id="line-45"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679562074"><span id="local-6989586621679562076"><span class="annot"><a href="GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="GHC.Exception.Type.html#SomeException"><span class="hs-identifier hs-type">SomeException</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-46"></span><span>    </span><span id="local-6989586621679562072"><span class="annot"><span class="annottext">showsPrec :: Int -&gt; SomeException -&gt; ShowS
</span><a href="GHC.Show.html#showsPrec"><span class="hs-identifier hs-var hs-var hs-var hs-var">showsPrec</span></a></span></span><span> </span><span id="local-6989586621679562070"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679562070"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Exception.Type.html#SomeException"><span class="hs-identifier hs-type">SomeException</span></a></span><span> </span><span id="local-6989586621679562065"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679562065"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; e -&gt; ShowS
forall a. Show a =&gt; Int -&gt; a -&gt; ShowS
</span><a href="GHC.Show.html#showsPrec"><span class="hs-identifier hs-var">showsPrec</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679562070"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679562065"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-47"></span><span>
</span><span id="line-48"></span><span class="hs-comment">{- |
Any type that you wish to throw or catch as an exception must be an
instance of the @Exception@ class. The simplest case is a new exception
type directly below the root:

&gt; data MyException = ThisException | ThatException
&gt;     deriving Show
&gt;
&gt; instance Exception MyException

The default method definitions in the @Exception@ class do what we need
in this case. You can now throw and catch @ThisException@ and
@ThatException@ as exceptions:

@
*Main&gt; throw ThisException \`catch\` \\e -&gt; putStrLn (\&quot;Caught \&quot; ++ show (e :: MyException))
Caught ThisException
@

In more complicated examples, you may wish to define a whole hierarchy
of exceptions:

&gt; ---------------------------------------------------------------------
&gt; -- Make the root exception type for all the exceptions in a compiler
&gt;
&gt; data SomeCompilerException = forall e . Exception e =&gt; SomeCompilerException e
&gt;
&gt; instance Show SomeCompilerException where
&gt;     show (SomeCompilerException e) = show e
&gt;
&gt; instance Exception SomeCompilerException
&gt;
&gt; compilerExceptionToException :: Exception e =&gt; e -&gt; SomeException
&gt; compilerExceptionToException = toException . SomeCompilerException
&gt;
&gt; compilerExceptionFromException :: Exception e =&gt; SomeException -&gt; Maybe e
&gt; compilerExceptionFromException x = do
&gt;     SomeCompilerException a &lt;- fromException x
&gt;     cast a
&gt;
&gt; ---------------------------------------------------------------------
&gt; -- Make a subhierarchy for exceptions in the frontend of the compiler
&gt;
&gt; data SomeFrontendException = forall e . Exception e =&gt; SomeFrontendException e
&gt;
&gt; instance Show SomeFrontendException where
&gt;     show (SomeFrontendException e) = show e
&gt;
&gt; instance Exception SomeFrontendException where
&gt;     toException = compilerExceptionToException
&gt;     fromException = compilerExceptionFromException
&gt;
&gt; frontendExceptionToException :: Exception e =&gt; e -&gt; SomeException
&gt; frontendExceptionToException = toException . SomeFrontendException
&gt;
&gt; frontendExceptionFromException :: Exception e =&gt; SomeException -&gt; Maybe e
&gt; frontendExceptionFromException x = do
&gt;     SomeFrontendException a &lt;- fromException x
&gt;     cast a
&gt;
&gt; ---------------------------------------------------------------------
&gt; -- Make an exception type for a particular frontend compiler exception
&gt;
&gt; data MismatchedParentheses = MismatchedParentheses
&gt;     deriving Show
&gt;
&gt; instance Exception MismatchedParentheses where
&gt;     toException   = frontendExceptionToException
&gt;     fromException = frontendExceptionFromException

We can now catch a @MismatchedParentheses@ exception as
@MismatchedParentheses@, @SomeFrontendException@ or
@SomeCompilerException@, but not other types, e.g. @IOException@:

@
*Main&gt; throw MismatchedParentheses \`catch\` \\e -&gt; putStrLn (\&quot;Caught \&quot; ++ show (e :: MismatchedParentheses))
Caught MismatchedParentheses
*Main&gt; throw MismatchedParentheses \`catch\` \\e -&gt; putStrLn (\&quot;Caught \&quot; ++ show (e :: SomeFrontendException))
Caught MismatchedParentheses
*Main&gt; throw MismatchedParentheses \`catch\` \\e -&gt; putStrLn (\&quot;Caught \&quot; ++ show (e :: SomeCompilerException))
Caught MismatchedParentheses
*Main&gt; throw MismatchedParentheses \`catch\` \\e -&gt; putStrLn (\&quot;Caught \&quot; ++ show (e :: IOException))
*** Exception: MismatchedParentheses
@

-}</span><span>
</span><span id="line-134"></span><span class="hs-keyword">class</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Typeable.Internal.html#Typeable"><span class="hs-identifier hs-type">Typeable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679562113"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679562113"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span id="Exception"><span class="annot"><a href="GHC.Exception.Type.html#Exception"><span class="hs-identifier hs-var">Exception</span></a></span></span><span> </span><span id="local-6989586621679562113"><span class="annot"><a href="#local-6989586621679562113"><span class="hs-identifier hs-type">e</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-135"></span><span>    </span><span id="toException"><span class="annot"><a href="GHC.Exception.Type.html#toException"><span class="hs-identifier hs-type">toException</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679562113"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Exception.Type.html#SomeException"><span class="hs-identifier hs-type">SomeException</span></a></span><span>
</span><span id="line-136"></span><span>    </span><span id="fromException"><span class="annot"><a href="GHC.Exception.Type.html#fromException"><span class="hs-identifier hs-type">fromException</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Exception.Type.html#SomeException"><span class="hs-identifier hs-type">SomeException</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679562113"><span class="hs-identifier hs-type">e</span></a></span><span>
</span><span id="line-137"></span><span>
</span><span id="line-138"></span><span>    </span><span id="local-6989586621679562060"><span class="annot"><a href="GHC.Exception.Type.html#toException"><span class="hs-identifier hs-var hs-var">toException</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">e -&gt; SomeException
forall e. Exception e =&gt; e -&gt; SomeException
</span><a href="GHC.Exception.Type.html#SomeException"><span class="hs-identifier hs-var">SomeException</span></a></span></span><span>
</span><span id="line-139"></span><span>    </span><span id="local-6989586621679562058"><span class="annot"><a href="GHC.Exception.Type.html#fromException"><span class="hs-identifier hs-var hs-var">fromException</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Exception.Type.html#SomeException"><span class="hs-identifier hs-type">SomeException</span></a></span><span> </span><span id="local-6989586621679562052"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679562052"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">e -&gt; Maybe e
forall a b. (Typeable a, Typeable b) =&gt; a -&gt; Maybe b
</span><a href="Data.Typeable.html#cast"><span class="hs-identifier hs-var">cast</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679562052"><span class="hs-identifier hs-var">e</span></a></span></span><span>
</span><span id="line-140"></span><span>
</span><span id="line-141"></span><span>    </span><span class="hs-comment">-- | Render this exception value in a human-friendly manner.</span><span>
</span><span id="line-142"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-143"></span><span>    </span><span class="hs-comment">-- Default implementation: @'show'@.</span><span>
</span><span id="line-144"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-145"></span><span>    </span><span class="hs-comment">-- @since 4.8.0.0</span><span>
</span><span id="line-146"></span><span>    </span><span id="displayException"><span class="annot"><a href="GHC.Exception.Type.html#displayException"><span class="hs-identifier hs-type">displayException</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679562113"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-147"></span><span>    </span><span id="local-6989586621679562050"><span class="annot"><a href="GHC.Exception.Type.html#displayException"><span class="hs-identifier hs-var hs-var">displayException</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">e -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span></span><span>
</span><span id="line-148"></span><span>
</span><span id="line-149"></span><span class="hs-comment">-- | @since 3.0</span><span>
</span><span id="line-150"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.Exception.Type.html#Exception"><span class="hs-identifier hs-type">Exception</span></a></span><span> </span><span class="annot"><a href="GHC.Exception.Type.html#SomeException"><span class="hs-identifier hs-type">SomeException</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-151"></span><span>    </span><span id="local-6989586621679562037"><span class="annot"><span class="annottext">toException :: SomeException -&gt; SomeException
</span><a href="#local-6989586621679562037"><span class="hs-identifier hs-var hs-var hs-var hs-var">toException</span></a></span></span><span> </span><span id="local-6989586621679562036"><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679562036"><span class="hs-identifier hs-var">se</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679562036"><span class="hs-identifier hs-var">se</span></a></span><span>
</span><span id="line-152"></span><span>    </span><span id="local-6989586621679562035"><span class="annot"><span class="annottext">fromException :: SomeException -&gt; Maybe SomeException
</span><a href="#local-6989586621679562035"><span class="hs-identifier hs-var hs-var hs-var hs-var">fromException</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SomeException -&gt; Maybe SomeException
forall a. a -&gt; Maybe a
</span><a href="GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span>
</span><span id="line-153"></span><span>    </span><span id="local-6989586621679562034"><span class="annot"><span class="annottext">displayException :: SomeException -&gt; String
</span><a href="#local-6989586621679562034"><span class="hs-identifier hs-var hs-var hs-var hs-var">displayException</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Exception.Type.html#SomeException"><span class="hs-identifier hs-type">SomeException</span></a></span><span> </span><span id="local-6989586621679562031"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679562031"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">e -&gt; String
forall e. Exception e =&gt; e -&gt; String
</span><a href="GHC.Exception.Type.html#displayException"><span class="hs-identifier hs-var">displayException</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679562031"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-154"></span><span>
</span><span id="line-155"></span><span class="hs-comment">-- |Arithmetic exceptions.</span><span>
</span><span id="line-156"></span><span class="hs-keyword">data</span><span> </span><span id="ArithException"><span class="annot"><a href="GHC.Exception.Type.html#ArithException"><span class="hs-identifier hs-var">ArithException</span></a></span></span><span>
</span><span id="line-157"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="Overflow"><span class="annot"><a href="GHC.Exception.Type.html#Overflow"><span class="hs-identifier hs-var">Overflow</span></a></span></span><span>
</span><span id="line-158"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="Underflow"><span class="annot"><a href="GHC.Exception.Type.html#Underflow"><span class="hs-identifier hs-var">Underflow</span></a></span></span><span>
</span><span id="line-159"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="LossOfPrecision"><span class="annot"><a href="GHC.Exception.Type.html#LossOfPrecision"><span class="hs-identifier hs-var">LossOfPrecision</span></a></span></span><span>
</span><span id="line-160"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="DivideByZero"><span class="annot"><a href="GHC.Exception.Type.html#DivideByZero"><span class="hs-identifier hs-var">DivideByZero</span></a></span></span><span>
</span><span id="line-161"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="Denormal"><span class="annot"><a href="GHC.Exception.Type.html#Denormal"><span class="hs-identifier hs-var">Denormal</span></a></span></span><span>
</span><span id="line-162"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="RatioZeroDenominator"><span class="annot"><a href="GHC.Exception.Type.html#RatioZeroDenominator"><span class="hs-identifier hs-var">RatioZeroDenominator</span></a></span></span><span> </span><span class="hs-comment">-- ^ @since 4.6.0.0</span><span>
</span><span id="line-163"></span><span>  </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span> </span><span id="local-6989586621679562021"><span id="local-6989586621679562023"><span class="annot"><span class="annottext">ArithException -&gt; ArithException -&gt; Bool
(ArithException -&gt; ArithException -&gt; Bool)
-&gt; (ArithException -&gt; ArithException -&gt; Bool) -&gt; Eq ArithException
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: ArithException -&gt; ArithException -&gt; Bool
$c/= :: ArithException -&gt; ArithException -&gt; Bool
== :: ArithException -&gt; ArithException -&gt; Bool
$c== :: ArithException -&gt; ArithException -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#Eq"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></a></span></span></span><span>  </span><span class="hs-comment">-- ^ @since 3.0</span><span>
</span><span id="line-164"></span><span>           </span><span class="hs-special">,</span><span> </span><span id="local-6989586621679562001"><span id="local-6989586621679562003"><span id="local-6989586621679562006"><span id="local-6989586621679562009"><span id="local-6989586621679562012"><span id="local-6989586621679562014"><span id="local-6989586621679562016"><span class="annot"><span class="annottext">Eq ArithException
Eq ArithException
-&gt; (ArithException -&gt; ArithException -&gt; Ordering)
-&gt; (ArithException -&gt; ArithException -&gt; Bool)
-&gt; (ArithException -&gt; ArithException -&gt; Bool)
-&gt; (ArithException -&gt; ArithException -&gt; Bool)
-&gt; (ArithException -&gt; ArithException -&gt; Bool)
-&gt; (ArithException -&gt; ArithException -&gt; ArithException)
-&gt; (ArithException -&gt; ArithException -&gt; ArithException)
-&gt; Ord ArithException
ArithException -&gt; ArithException -&gt; Bool
ArithException -&gt; ArithException -&gt; Ordering
ArithException -&gt; ArithException -&gt; ArithException
forall a.
Eq a
-&gt; (a -&gt; a -&gt; Ordering)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; a)
-&gt; (a -&gt; a -&gt; a)
-&gt; Ord a
min :: ArithException -&gt; ArithException -&gt; ArithException
$cmin :: ArithException -&gt; ArithException -&gt; ArithException
max :: ArithException -&gt; ArithException -&gt; ArithException
$cmax :: ArithException -&gt; ArithException -&gt; ArithException
&gt;= :: ArithException -&gt; ArithException -&gt; Bool
$c&gt;= :: ArithException -&gt; ArithException -&gt; Bool
&gt; :: ArithException -&gt; ArithException -&gt; Bool
$c&gt; :: ArithException -&gt; ArithException -&gt; Bool
&lt;= :: ArithException -&gt; ArithException -&gt; Bool
$c&lt;= :: ArithException -&gt; ArithException -&gt; Bool
&lt; :: ArithException -&gt; ArithException -&gt; Bool
$c&lt; :: ArithException -&gt; ArithException -&gt; Bool
compare :: ArithException -&gt; ArithException -&gt; Ordering
$ccompare :: ArithException -&gt; ArithException -&gt; Ordering
</span><a href="../../ghc-prim/src/GHC.Classes.html#Ord"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Ord</span></a></span></span></span></span></span></span></span></span><span> </span><span class="hs-comment">-- ^ @since 3.0</span><span>
</span><span id="line-165"></span><span>           </span><span class="hs-special">)</span><span>
</span><span id="line-166"></span><span>
</span><span id="line-167"></span><span class="annot"><a href="GHC.Exception.Type.html#divZeroException"><span class="hs-identifier hs-type">divZeroException</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Exception.Type.html#overflowException"><span class="hs-identifier hs-type">overflowException</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Exception.Type.html#ratioZeroDenomException"><span class="hs-identifier hs-type">ratioZeroDenomException</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Exception.Type.html#underflowException"><span class="hs-identifier hs-type">underflowException</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Exception.Type.html#SomeException"><span class="hs-identifier hs-type">SomeException</span></a></span><span>
</span><span id="line-168"></span><span id="divZeroException"><span class="annot"><span class="annottext">divZeroException :: SomeException
</span><a href="GHC.Exception.Type.html#divZeroException"><span class="hs-identifier hs-var hs-var">divZeroException</span></a></span></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ArithException -&gt; SomeException
forall e. Exception e =&gt; e -&gt; SomeException
</span><a href="GHC.Exception.Type.html#toException"><span class="hs-identifier hs-var">toException</span></a></span><span> </span><span class="annot"><span class="annottext">ArithException
</span><a href="GHC.Exception.Type.html#DivideByZero"><span class="hs-identifier hs-var">DivideByZero</span></a></span><span>
</span><span id="line-169"></span><span id="overflowException"><span class="annot"><span class="annottext">overflowException :: SomeException
</span><a href="GHC.Exception.Type.html#overflowException"><span class="hs-identifier hs-var hs-var">overflowException</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ArithException -&gt; SomeException
forall e. Exception e =&gt; e -&gt; SomeException
</span><a href="GHC.Exception.Type.html#toException"><span class="hs-identifier hs-var">toException</span></a></span><span> </span><span class="annot"><span class="annottext">ArithException
</span><a href="GHC.Exception.Type.html#Overflow"><span class="hs-identifier hs-var">Overflow</span></a></span><span>
</span><span id="line-170"></span><span id="ratioZeroDenomException"><span class="annot"><span class="annottext">ratioZeroDenomException :: SomeException
</span><a href="GHC.Exception.Type.html#ratioZeroDenomException"><span class="hs-identifier hs-var hs-var">ratioZeroDenomException</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ArithException -&gt; SomeException
forall e. Exception e =&gt; e -&gt; SomeException
</span><a href="GHC.Exception.Type.html#toException"><span class="hs-identifier hs-var">toException</span></a></span><span> </span><span class="annot"><span class="annottext">ArithException
</span><a href="GHC.Exception.Type.html#RatioZeroDenominator"><span class="hs-identifier hs-var">RatioZeroDenominator</span></a></span><span>
</span><span id="line-171"></span><span id="underflowException"><span class="annot"><span class="annottext">underflowException :: SomeException
</span><a href="GHC.Exception.Type.html#underflowException"><span class="hs-identifier hs-var hs-var">underflowException</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ArithException -&gt; SomeException
forall e. Exception e =&gt; e -&gt; SomeException
</span><a href="GHC.Exception.Type.html#toException"><span class="hs-identifier hs-var">toException</span></a></span><span> </span><span class="annot"><span class="annottext">ArithException
</span><a href="GHC.Exception.Type.html#Underflow"><span class="hs-identifier hs-var">Underflow</span></a></span><span>
</span><span id="line-172"></span><span>
</span><span id="line-173"></span><span class="hs-comment">-- | @since 4.0.0.0</span><span>
</span><span id="line-174"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679561990"><span id="local-6989586621679561992"><span id="local-6989586621679561994"><span class="annot"><a href="GHC.Exception.Type.html#Exception"><span class="hs-identifier hs-type">Exception</span></a></span><span> </span><span class="annot"><a href="GHC.Exception.Type.html#ArithException"><span class="hs-identifier hs-type">ArithException</span></a></span></span></span></span><span>
</span><span id="line-175"></span><span>
</span><span id="line-176"></span><span class="hs-comment">-- | @since 4.0.0.0</span><span>
</span><span id="line-177"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679561985"><span id="local-6989586621679561987"><span class="annot"><a href="GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="GHC.Exception.Type.html#ArithException"><span class="hs-identifier hs-type">ArithException</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-178"></span><span>  </span><span id="local-6989586621679561984"><span class="annot"><span class="annottext">showsPrec :: Int -&gt; ArithException -&gt; ShowS
</span><a href="#local-6989586621679561984"><span class="hs-identifier hs-var hs-var hs-var hs-var">showsPrec</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ArithException
</span><a href="GHC.Exception.Type.html#Overflow"><span class="hs-identifier hs-var">Overflow</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
</span><a href="GHC.Show.html#showString"><span class="hs-identifier hs-var">showString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;arithmetic overflow&quot;</span></span><span>
</span><span id="line-179"></span><span>  </span><span class="annot"><a href="GHC.Show.html#showsPrec"><span class="hs-identifier hs-var">showsPrec</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ArithException
</span><a href="GHC.Exception.Type.html#Underflow"><span class="hs-identifier hs-var">Underflow</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
</span><a href="GHC.Show.html#showString"><span class="hs-identifier hs-var">showString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;arithmetic underflow&quot;</span></span><span>
</span><span id="line-180"></span><span>  </span><span class="annot"><a href="GHC.Show.html#showsPrec"><span class="hs-identifier hs-var">showsPrec</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ArithException
</span><a href="GHC.Exception.Type.html#LossOfPrecision"><span class="hs-identifier hs-var">LossOfPrecision</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
</span><a href="GHC.Show.html#showString"><span class="hs-identifier hs-var">showString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;loss of precision&quot;</span></span><span>
</span><span id="line-181"></span><span>  </span><span class="annot"><a href="GHC.Show.html#showsPrec"><span class="hs-identifier hs-var">showsPrec</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ArithException
</span><a href="GHC.Exception.Type.html#DivideByZero"><span class="hs-identifier hs-var">DivideByZero</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
</span><a href="GHC.Show.html#showString"><span class="hs-identifier hs-var">showString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;divide by zero&quot;</span></span><span>
</span><span id="line-182"></span><span>  </span><span class="annot"><a href="GHC.Show.html#showsPrec"><span class="hs-identifier hs-var">showsPrec</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ArithException
</span><a href="GHC.Exception.Type.html#Denormal"><span class="hs-identifier hs-var">Denormal</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
</span><a href="GHC.Show.html#showString"><span class="hs-identifier hs-var">showString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;denormal&quot;</span></span><span>
</span><span id="line-183"></span><span>  </span><span class="annot"><a href="GHC.Show.html#showsPrec"><span class="hs-identifier hs-var">showsPrec</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ArithException
</span><a href="GHC.Exception.Type.html#RatioZeroDenominator"><span class="hs-identifier hs-var">RatioZeroDenominator</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
</span><a href="GHC.Show.html#showString"><span class="hs-identifier hs-var">showString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Ratio has zero denominator&quot;</span></span><span>
</span><span id="line-184"></span></pre></body></html>